package com.dd.common.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import java.io.Serializable;

@Data
@Schema(name = "分页参数")
public class PageDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 当前页码
     */
    @DecimalMin(value = "1", message = "current参数必须大于0的数字")
    @Schema(description = "当前页码")
    private Integer current = 1;

    /**
     * 每页条数
     */
    @DecimalMin(value = "1", message = "size参数必须是大于0的数字")
    @DecimalMax(value = "1000", message = "size参数必须是小于1000的数字")
    @Schema(description = "每页条数")
    private Integer size = 20;

}
